if PDF_status(sprite pSprite) then alert "PDF Behavior Error"&RETURN&PDF_error(sprite pSprite)
end doOpen
on mouseUp me
if (pEvent = #mouseUp) then doOpen(me)
end mouseUp
on mouseDown me
if (pEvent = #mouseDown) then doOpen(me)
end mouseDown
on prepareFrame me
if (pEvent = #prepareFrame) then doOpen(me)
end prepareFrame
-- standard behavior stuff --
on getPropertyDescriptionList me
set defaultValues = GetDefaultValues (me)
set pdfSpriteList = getProp (defaultValues, #spriteList)
set defSprite = getProp (defaultValues, #defaultSprite)
if (defSprite=0) then
if the ticks - pAlertFlag > 10 then
alert "Please create a sprite of type PDF first."
end if
set pAlertFlag = the ticks -- The ticks when the user clicked "OK"
exit
end if
set defFieldMember = FindFirstMember(#field)
if (string(defFieldMember) contains "member 0") then
alert "You need at least one member of type #field to use this behavior."
exit
end if
set p_list = [#pEvent: [ #comment: "Event", #format:#symbol, #range:[#mouseUp, #mouseDown, #prepareFrame], #default:#mouseUp],#pSprite: [ #comment: "PDF Sprite is in channel:", #format:#symbol, #range:pdfSpriteList, #default:defSprite],#pMemberName: [#comment: "File name is in field:", #format: #field, #default:defFieldMember],#pPathType: [ #comment: "Path is:", #format: #symbol,#range: [ "Absolute or URL", "Relative to Movie", "Relative to Playback Engine" ],#default: "Absolute or URL" ],#pPage: [ #comment: "Start at page:", #format: #integer, #default:1 ],#pZoom: [ #comment: "Start at zoom:", #format:#symbol, #range:["Fit in Window", "Actual Size", "Fit Width", "Fit Height","Fit Visible", "Other (specify below)"], #default:"Fit Visible"],#pScale: [ #comment: "Other zoom (8..1600):", #format:#integer, #default:""],#pDisplayMode: [ #comment: "Display mode:", #format:#symbol, #range:["Pages Only", "Bookmarks and Pages", "Thumbnails and Pages"],#default:"Pages Only" ],#pToolbar: [ #comment: "Show Toolbar:", #format:#boolean, #default:TRUE ],#pScrollbars: [ #comment: "Show Scrollbars:", #format:#boolean, #default:TRUE ],#pScrollH: [ #comment: "Scroll H:", #format: #integer, #default:0 ],#pScrollV: [ #comment: "Scroll V:", #format: #integer, #default:0 ]]
return p_list
end
on getBehaviorDescription
return "Link the PDF document whose name is specified in a Director field to the designated PDF Xtra sprite. If the designated sprite is already linked to a PDF document, that document is first closed and then the new one opened. Parameters are: " &RETURN& "- Page to start at" &RETURN& "- Scaling (fit in window, actual size, fit width, fit height, fit visible or a percentage in the range [8..1600])" &RETURN& "- Display mode (pages only, bookmarks and pages, thumbnails and pages)" &RETURN& "- Show/hide toolbars" &RETURN& "- Show/hide scrollbars" &RETURN& "- Intital H/V scroll position." &RETURN& "Free to use and abuse. (c)1999, Integration New Media, Inc." &RETURN& "Thanks to James Newton for his suggestions"